import 'package:auto_route/auto_route.dart';
import 'package:distribution_mall_flutter/constant/cf_constant.dart';
import 'package:distribution_mall_flutter/constant/constant.dart';
import 'package:distribution_mall_flutter/generated/l10n.dart';
import 'package:distribution_mall_flutter/utils/common_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';

import '../../router/router.gr.dart';

@RoutePage()
class AgreementPage extends ConsumerStatefulWidget {
  const AgreementPage({super.key});

  @override
  ConsumerState<AgreementPage> createState() => _AgreementPageState();
}

class _AgreementPageState extends ConsumerState<AgreementPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(S.current.legal_policies),
        centerTitle: true,
        leading: CommonBtnWidget.arrowBack(),
      ),
      body: Container(
        margin: const EdgeInsets.only(top: 10),
        child: Column(
          children: [
            ListTile(
              title: Text(S.current.terms_services),
              contentPadding: const EdgeInsets.only(left: 20, right: 20),
              trailing: const Icon(
                Icons.arrow_forward_ios,
                color: ColorConstant.grey114,
                size: 12,
              ),
              onTap: () {
                appRouter.push(PrivacyRoute(
                    title: S.current.terms_services,
                    indexKey: 'terms-of-service'));
              },
            ),
            Container(
              margin: const EdgeInsets.only(left: 20, right: 20),
              child: const Divider(
                height: 1,
              ),
            ),
            ListTile(
              contentPadding: const EdgeInsets.only(left: 20, right: 20),
              trailing: const Icon(
                Icons.arrow_forward_ios,
                color: ColorConstant.grey114,
                size: 12,
              ),
              title: Text(S.current.privary_policy),
              onTap: () {
                appRouter.push(PrivacyRoute(
                    title: S.current.terms_services,
                    indexKey: 'privacy-policy'));
              },
            ),
          ],
        ),
      ),
    );
  }
}
